package com.test.burnincash.activity_fragment_burnin.base_burnin;

import android.net.Uri;

import com.test.burnincash.activity_fragment_burnin.loan_burnin.LoanApplyActivity_burnin;
import com.test.burnincash.bean_burnin.process_burnin.ProcessInfo_burnin;
import com.test.burnincash.util_burnin.http_burnin.HttpManager_burnin;
import com.test.burnincash.activity_fragment_burnin.info_burnin.InfoUploadActivity_burnin;


public abstract class BaseInfoActivity_burnin extends BaseActivity_burnin {

    public Uri photoUri_burnin;

    private Runnable onPermissionAllPassRun_burnin;

    public void onInfoUploadResponse_burnin(){
        HttpManager_burnin.getInstance().requestUserProcess();
    }

    @Override
    public void onUserProcessResponse_burnin() {

        if (ProcessInfo_burnin.getInstance().getStepsSize()>0){
            startActivity_burnin(InfoUploadActivity_burnin.class);
        }

        //越南额外流程
//        else if (StaticConfig_burnin.Select_Country.equalsIgnoreCase(Constant_burnin.Country_Vietnam)&& ProcessInfo_burnin.getInstance().getExtStep().size()>0){
//            handleVietnamExtProcess_burnin();
//        }

        else {
            //如果不是处理还款流程、状态流程、认证流程，直接去借款确认页
            startActivity_burnin(LoanApplyActivity_burnin.class);
            HttpManager_burnin.getInstance().requestLoanApplyDetail();
        }

        finish();

    }

    public void onLoanApplyDetailResponse_burnin(){
        startActivity_burnin(LoanApplyActivity_burnin.class);
    }

    public void setOnPermissionAllPassRun_burnin(Runnable onPermissionAllPassRun_burnin) {
        this.onPermissionAllPassRun_burnin = onPermissionAllPassRun_burnin;
    }

    @Override
    protected void onLaunchPermissionsAllPass_burnin() {
        if (onPermissionAllPassRun_burnin !=null){
            onPermissionAllPassRun_burnin.run();
            onPermissionAllPassRun_burnin = null;
        }
    }
}
